#include<cstdio>

long long mod(long long a,long long b)
{
return (a % b + b) % b;
}

struct triple
{
long long d,x,y;
};

long long Euclid(long long a,long long b)
{
if(b == 0)
   return a;
else
   return Euclid(b,mod(a,b));
}

triple Extended_Euclid(long long a,long long b)
{
triple result;
if(b == 0)
{
   result.d = a;
   result.x = 1;
   result.y = 0;
}
else
{
   triple ee = Extended_Euclid(b,mod(a,b));
   result.d = ee.d;
   result.x = ee.y;
   result.y = ee.x - (a/b)*ee.y;
}
return result;
}

long long MLES(long long a,long long b,long long n)
{
triple ee = Extended_Euclid(a,n);
if(mod(b,ee.d) == 0)
   return mod((ee.x * (b / ee.d)),n/ee.d);
else
   return -1;
}

int main()
{
     long long x, y, m, n, l;
     while(scanf("%I64d%I64d%I64d%I64d%I64d",&x,&y,&m,&n,&l) != EOF){
long long mles;
mles = MLES(m-n,y-x,l);
if(mles < 0)
         printf("Impossible\n");
     else
         printf("%I64d\n",mles);
}
     return 0;
}
